Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a couple of db.runCommand() issues #81

Merged
merged 3 commits into from
Aug 31, 2013
Merged

Fix a couple of db.runCommand() issues #81

merged 3 commits into from
Aug 31, 2013

Conversation

sorribas
Copy link
Collaborator

This fixes 2 use cases of the db.runCommand() that didn't work on mongojs. The first was to run a database command that doesn't receive a parameter such as db.ping(). For example the following statements

db.runCommand({ping:1});
db.runCommand('ping');

Are equivalent in the mongo shell. The first worked in mongojs but the second didn't.

The other case was using a command that gets applied to a collection without parameters such as

db.runCommand('count');
db.runCommand('count', {});

These 2 lines are equivalent in the mongo shell but the first one didn't work on mongojs. This pull request fixes both this issues, adds a test case for each one and updates the docs accordingly.

@sorribas
Copy link
Collaborator Author

There you go. I think that's better.

mafintosh added a commit that referenced this pull request Aug 31, 2013
Fix a couple of db.runCommand() issues
@mafintosh mafintosh merged commit 16a2731 into mongo-js:master Aug 31, 2013
@mafintosh
Copy link
Collaborator

Great stuff (as usual)!

@sorribas
Copy link
Collaborator Author

Thanks.

@mafintosh
Copy link
Collaborator

Released as 0.8.0

@mderazon mderazon mentioned this pull request Jun 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants